import {session } from '@/service/storage.service';
const { VITE_USER_TOKEN } = import.meta.env;


export function beforeHook(to, from, next) {
  if (to.path === '/login') {
    session.remove(VITE_USER_TOKEN);
    next();
  }else if (!session.get(VITE_USER_TOKEN)) {
    next('/login');
  } else {
    next();
  }
}

